package com.wy.powerbuilder.service.impl.hxl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.wy.powerbuilder.entity.hxl.carcontract;
import com.wy.powerbuilder.entity.hxl.carseat;
import com.wy.powerbuilder.mapper.hxl.carseatMapper;
import com.wy.powerbuilder.service.hxl.carseatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

@Service
public class carseatServiceImpl implements carseatService {

    @Autowired
    private carseatMapper carseat;

    @Autowired
    private carseatService carseatser;


    @Override
    public int delete(Integer cs_id) {
        return carseat.delete(cs_id);
    }

    @Override
    public int deleteall(String cs_id) {
        return deleteall(cs_id);
    }

    @Override
    public PageInfo<carseat> selByPagecar(Integer pageNum, Integer pageSize, String cS_number) {
        if(pageNum==null){
            pageNum = 1;//默认查询第一页
        }
        //对查询的信息进行分页
        //第一个参数当前页码,第二个每页的条数
        PageHelper.startPage(pageNum,pageSize) ; //使用分页插件开始分页
        //查询我们将要分页的信息
        List<carseat> students = carseat.carselecar(cS_number);
        //将查询的学生信息放到分页对象中去
        PageInfo<carseat> pageInfo = new PageInfo<>(students);
        return pageInfo;
    }

    @Override
    public List<carseat> carselecar(String cS_number) {
        return carseat.carselecar(cS_number);
    }

    @Override
    public carseat managementselect(String cS_number) {
        return carseat.managementselect(cS_number);
    }
}
